package com.ww.gss.dao;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ww.gss.exceptions.DAOException;
import com.ww.gss.vo.UserVO;

@Repository
public class UserDAO {
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	public int  create(UserVO t) throws DAOException {
		int result;
		try {
			result = sqlSessionTemplate.insert("com.ww.gss.dao.AccountVOMapper.insert", t);
		} catch (Exception e) {
			throw new DAOException(e);
		}
		return result;
	}

    public int update(UserVO t) throws DAOException {
		int result;
		try {
			result = sqlSessionTemplate.update("com.ww.gss.dao.AccountVOMapper.updateByPrimaryKeySelective", t);
		} catch (Exception e) {
			throw new DAOException(e);
		}
		return result;
	}
}